from django.db import models


# 买家用户模型
class BuyerUser(models.Model):
    telephone = models.CharField(max_length=11)
    password = models.CharField(max_length=32)

    username = models.CharField(max_length=32)
    photo = models.ImageField(upload_to='images', null=True, blank=True)
    age = models.CharField(max_length=32, null=True, blank=True)
    gender = models.CharField(max_length=32, null=True, blank=True)
    address = models.TextField(max_length=254, null=True, blank=True)
    email = models.EmailField(null=True, blank=True)


# 验证码模型
class ValidCode(models.Model):
    code_content = models.CharField(max_length=32)
    code_user = models.CharField(max_length=32)
    code_time = models.DateTimeField(auto_now=True)
    code_state = models.IntegerField(default=0)  # 1使用 0未使用

# Create your models here.
